<?php
require_once('../../conf/config.php.inc');
require_once(SYBMAS_LIB_PATH.'/liblogin.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/layout.php.inc');
require_once(SYBMAS_LIB_PATH.'/libsybase.php.inc');
require_once(SYBMAS_LIB_PATH.'/libsybmas.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/menu.php.inc');
verificar_inicio_sesion();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/sybmasstyle.css">
<script src="<?php echo LAYOUT_URI?>/jquery-1.2.1.min.js"
	type="text/javascript"></script>
<script src="<?php echo LAYOUT_URI?>/menu-collapsed.js"
	type="text/javascript"></script>
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/style.css" >
<link rel="stylesheet" type="text/css"
	href="<?php echo JAVASCRIPT_URI?>/tabs/tabs.css">
<script src="<?php echo JAVASCRIPT_URI?>/tabs/tabs.js"
	type="text/javascript"></script>
<title>.:: Sybmas - Confirmacion de la Creacion de Bases de Datos</title>
<!--[if lt IE 8]>
   <style type="text/css">
   li a {display:inline-block;}
   li a {display:block;}
   </style>
   <![endif]-->
</head>
<body>
<script src="<?php echo JAVASCRIPT_URI?>/tooltip/wz_tooltip.js"
	type="text/javascript"></script>
<center>
<div id="container">
<div id="header"><?php generar_header();?></div>
<div id="scene">
<div id="modulos">
<ul id="menu" style="width: 150px;">
<?php generar_menu();?>
</ul>
</div>

<div id="title">Confirmacion de la Creacion de Bases de Datos</div>
<div id="main">

<?php 
$namebd=$_POST['sybmas_bd'];
//echo $namebd;
$devicebd=$_POST['devicebd'];
//echo $devicebd;
$sizedevicebd=$_POST['sybmas_size'];
$devicelog=$_POST['bdlog'];
$sizedevicelog=$_POST['sybmas_sizelog'];


	$sybmas_connection=start_default_sybuser_connection();
	@sybase_select_db(master);
	$query="CREATE DATABASE $namebd ON $devicebd=$sizedevicebd LOG ON $devicelog=$sizedevicelog ";
	sybase_set_message_handler("void_msg_handler",$sybmas_connection);
	$resultado=sybase_query($query,$sybmas_connection);
	sybase_set_message_handler("msg_handler",$sybmas_connection);

  if(!$resultado) {
  	 echo "<br>";
  	 echo "<h1><b>No se pudo Crear la Base de Datos <i>$namebd</i></b></h1>";
  	 echo "<h4>".sybase_get_last_message()."</h4>";  	 
  } else {
  
     echo "<br>";
  	 echo "<h1><b>La Base de Datos <i>$namebd</i> ha sido creada correctamente</b></h1>";
  }	 
  sybase_close($sybmas_connection);	 
?>

<a href="<?php echo CONTEXT_NAME?>/modulos/basesdatos/crearBD.php" >
	<img src="<?php echo IMG_URI?>/script_go.png"
		 width="18" height="18" border="0">  Regresar</a>

</div>
<!-- main --></div>
<!--scene--><?php generar_footer();?></div>
</center>
</body>
</html>

